<?php
/* @var $this CategoryController */
/* @var $model Category */
/* @var $form CActiveForm */
?>
<script src="<?php echo Yii::app()->theme->baseUrl ?>/lib/ckeditor/ckeditor.js"></script>

<div class="box">
	<div class="box-title">
		<h4><i class="icon-briefcase"></i>
		<?php echo $model->isNewRecord ? 'New Category' : $model->name ?>
		</h4>
	</div>
	<div class="box-content">
		<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'edit-form',
			'enableClientValidation' => true,
			'clientOptions'=> array('validateOnSubmit'=>true),
			'htmlOptions' => array('class'=>'form-horizontal')
		)); ?>

		<?php if($model->hasErrors()): ?>
		<div class="control-group">
			<?php echo $form->errorSummary($model); ?>
		</div>
		<?php endif ?>

		<div class="control-group">
			<?php echo $form->labelEx($model,'name', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->textField($model,'name',array('class'=>'span8','maxlength'=>200)); ?>
				<?php echo $form->error($model,'name'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'parent_category_id', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->dropDownList($model,'parent_category_id',$model->getParentCategoryListData(), array('encode'=>false,'empty'=>'')); ?>
				<?php echo $form->error($model,'parent_category_id'); ?>
			</div>
		</div>

		<div class="control-group">
			<?php echo $form->labelEx($model,'position', array('class'=>'control-label')); ?>
			<div class="controls">
				<?php echo $form->textField($model,'position'); ?>
				<?php echo $form->error($model,'position'); ?>
			</div>
		</div>

		<?php $this->endWidget(); ?>
	</div>
</div>

